import * as Sentry from '@sentry/browser';

export function initSentry() {
  Sentry.init({
    dsn: 'http://85ad42f93d7942da88211cf650ee4afd@localhost:9001/2',
  });
}

export function sendError(error, errorInfo) {
  let eventId = null;
  Sentry.withScope(scope => {
    scope.setExtras(errorInfo);
    eventId = Sentry.captureException(error);
  });
  return eventId;
}

export default {
  initSentry,
  sendError,
};
